<template>
  <el-select v-model="product_line" placeholder="请选择产品线" @change="changePr">
    <el-option
      v-for="item in list"
      :key="item.id"
      :label="item.name"
      :value="item.id">
    </el-option>
  </el-select>
</template>

<script>
    import Resource from '@/api/Resource';
    const apiResource = new Resource('productLine');
    export default {
        name: "Index",
        data() {
            return {
                list: [],
                product_line:'',
            }
        },
        created() {
            this.getList()
        },
        methods:{
            async getList(){
                const { data } = await apiResource.list({});
                this.list=data;
            },
            changePr(){
                this.$emit('func',this.product_line)
            }
        }
    }
</script>

<style scoped>

</style>
